package kernel_gui.gui.generic.graphic;

import java.awt.AWTError;
import java.awt.Point;
import java.awt.Toolkit;

import kernel_gui.gui.generic.BackGroundPanel;
import kernel_gui.gui.generic.MillionaireFrame;


/**
 *
 * @author Yoyo
 */
@SuppressWarnings("serial")
public abstract class ControlImport extends MillionaireFrame {

    /** Creates new form LoginFrame */
    public ControlImport() {
    	super(true);
        initComponents();
    }

    private void initComponents() {

        LayeredPane = new javax.swing.JLayeredPane();
        LoadingPanel = new javax.swing.JPanel();
        SpinningDollarLabel = new javax.swing.JLabel();
        TopMessageLabel = new javax.swing.JLabel();
        TopMessageLabel1 = new javax.swing.JLabel();
        CancelButton = new javax.swing.JButton();
        MainPanel = new javax.swing.JPanel();
        SmallUpdateButton = new javax.swing.JButton();
        BigUpdateButton = new javax.swing.JButton();
        ImportButton = new javax.swing.JButton();
        GenerateQuestionsButton = new javax.swing.JButton();
        BackButton = new javax.swing.JButton();
        TopHeaderLabel = new javax.swing.JLabel();
        ButtonHeaderLabel = new javax.swing.JLabel();
        Separator = new javax.swing.JSeparator();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        /* My init code */
    	int frameWidth = 190;
    	int frameHeight = 340;
    	this.setIconImage(new javax.swing.ImageIcon("images/Green-Dollar-icon.png").getImage());
    	LayeredPane.setOpaque(false);
    	LoadingPanel.setVisible(false);
    	LoadingPanel.setOpaque(false);
    	setResizable(false);
    	try{
    		Toolkit tk = Toolkit.getDefaultToolkit();
    		int framePosWidth = tk.getScreenSize().width / 2 - frameWidth / 2;
    		int framePosHeight = tk.getScreenSize().height / 2 - frameHeight / 2;
    		Point p = new Point(framePosWidth, framePosHeight);
    		this.setLocation(p);
    		
    	}catch(AWTError e){
    		/*Nothing to do*/
    	}
    	BGPanel = new BackGroundPanel(frameWidth, frameHeight);
        MainPanel = new BackGroundPanel(frameWidth, frameHeight);
    	SpinningDollarLabel.setIcon(new javax.swing.ImageIcon(
    			"images/dollar-spinning.gif")); // NOI18N
    	/* end */

        LayeredPane.setOpaque(true);

        LoadingPanel.setOpaque(false);
        LoadingPanel.setPreferredSize(new java.awt.Dimension(145, 335));


        TopMessageLabel.setBackground(new java.awt.Color(51, 102, 0));
        TopMessageLabel.setFont(new java.awt.Font("Tahoma", 1, 14));
        TopMessageLabel.setForeground(new java.awt.Color(51, 204, 0));
        TopMessageLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        TopMessageLabel.setText("Loading");
        TopMessageLabel.setOpaque(true);

        TopMessageLabel1.setBackground(new java.awt.Color(51, 102, 0));
        TopMessageLabel1.setFont(new java.awt.Font("Tahoma", 1, 14));
        TopMessageLabel1.setForeground(new java.awt.Color(51, 204, 0));
        TopMessageLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        TopMessageLabel1.setText("Please wait");
        TopMessageLabel1.setOpaque(true);

        CancelButton.setFont(new java.awt.Font("Tahoma", 1, 14));
        CancelButton.setText("Cancel");
        CancelButton.setEnabled(false);
        CancelButton.setOpaque(false);
        CancelButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                CancelButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout LoadingPanelLayout = new javax.swing.GroupLayout(LoadingPanel);
        LoadingPanel.setLayout(LoadingPanelLayout);
        LoadingPanelLayout.setHorizontalGroup(
            LoadingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(LoadingPanelLayout.createSequentialGroup()
                .addGap(45, 45, 45)
                .addGroup(LoadingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(SpinningDollarLabel)
                    .addComponent(TopMessageLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 100, Short.MAX_VALUE)
                    .addComponent(TopMessageLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 100, Short.MAX_VALUE)
                    .addComponent(CancelButton))
                .addGap(45, 45, 45))
        );
        LoadingPanelLayout.setVerticalGroup(
            LoadingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, LoadingPanelLayout.createSequentialGroup()
                .addContainerGap(80, Short.MAX_VALUE)
                .addComponent(SpinningDollarLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(TopMessageLabel)
                .addGap(18, 18, 18)
                .addComponent(TopMessageLabel1)
                .addGap(33, 33, 33)
                .addComponent(CancelButton)
                .addGap(77, 77, 77))
        );

        LoadingPanel.setBounds(0, 0, 190, 350);
        LayeredPane.add(LoadingPanel, javax.swing.JLayeredPane.DEFAULT_LAYER);

        MainPanel.setOpaque(false);

        SmallUpdateButton.setFont(new java.awt.Font("Tahoma", 1, 14));
        SmallUpdateButton.setText("Small Update");
        SmallUpdateButton.setOpaque(false);
        SmallUpdateButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SmallUpdateButtonActionPerformed(evt);
            }
        });

        BigUpdateButton.setFont(new java.awt.Font("Tahoma", 1, 14));
        BigUpdateButton.setText("Big Update");
        BigUpdateButton.setOpaque(false);
        BigUpdateButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BigUpdateButtonActionPerformed(evt);
            }
        });

        ImportButton.setFont(new java.awt.Font("Tahoma", 1, 14));
        ImportButton.setText("Import");
        ImportButton.setOpaque(false);
        ImportButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ImportButtonActionPerformed(evt);
            }
        });

        GenerateQuestionsButton.setFont(new java.awt.Font("Tahoma", 1, 14));
        GenerateQuestionsButton.setText("Generate Questions");
        GenerateQuestionsButton.setOpaque(false);
        GenerateQuestionsButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                GenerateQuestionsButtonActionPerformed(evt);
            }
        });

        BackButton.setFont(new java.awt.Font("Tahoma", 1, 14));
        BackButton.setText("Back");
        BackButton.setOpaque(false);
        BackButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BackButtonActionPerformed(evt);
            }
        });

        TopHeaderLabel.setFont(new java.awt.Font("Tahoma", 1, 26));
        TopHeaderLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        TopHeaderLabel.setText("Import");

        ButtonHeaderLabel.setFont(new java.awt.Font("Tahoma", 1, 26)); // NOI18N
        ButtonHeaderLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        ButtonHeaderLabel.setText("To DB");

        javax.swing.GroupLayout MainPanelLayout = new javax.swing.GroupLayout(MainPanel);
        MainPanel.setLayout(MainPanelLayout);
        MainPanelLayout.setHorizontalGroup(
            MainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(MainPanelLayout.createSequentialGroup()
                .addGroup(MainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(MainPanelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(BigUpdateButton, javax.swing.GroupLayout.DEFAULT_SIZE, 170, Short.MAX_VALUE))
                    .addGroup(MainPanelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(ImportButton, javax.swing.GroupLayout.DEFAULT_SIZE, 170, Short.MAX_VALUE))
                    .addGroup(MainPanelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(GenerateQuestionsButton, javax.swing.GroupLayout.DEFAULT_SIZE, 170, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, MainPanelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(BackButton, javax.swing.GroupLayout.DEFAULT_SIZE, 170, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, MainPanelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(Separator, javax.swing.GroupLayout.DEFAULT_SIZE, 170, Short.MAX_VALUE))
                    .addGroup(MainPanelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(SmallUpdateButton, javax.swing.GroupLayout.DEFAULT_SIZE, 170, Short.MAX_VALUE)))
                .addContainerGap())
            .addComponent(ButtonHeaderLabel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 190, Short.MAX_VALUE)
            .addComponent(TopHeaderLabel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 190, Short.MAX_VALUE)
        );
        MainPanelLayout.setVerticalGroup(
            MainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(MainPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(TopHeaderLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(ButtonHeaderLabel)
                .addGap(25, 25, 25)
                .addComponent(SmallUpdateButton, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(BigUpdateButton, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(ImportButton, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(GenerateQuestionsButton, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(Separator, javax.swing.GroupLayout.PREFERRED_SIZE, 7, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(BackButton, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(22, Short.MAX_VALUE))
        );

        MainPanel.setBounds(0, 0, 190, 350);
        LayeredPane.add(MainPanel, javax.swing.JLayeredPane.DEFAULT_LAYER);

        javax.swing.GroupLayout BGPanelLayout = new javax.swing.GroupLayout(BGPanel);
        BGPanel.setLayout(BGPanelLayout);
        BGPanelLayout.setHorizontalGroup(
            BGPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 191, Short.MAX_VALUE)
            .addGroup(BGPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(LayeredPane, javax.swing.GroupLayout.DEFAULT_SIZE, 191, Short.MAX_VALUE))
        );
        BGPanelLayout.setVerticalGroup(
            BGPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 348, Short.MAX_VALUE)
            .addGroup(BGPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(LayeredPane, javax.swing.GroupLayout.DEFAULT_SIZE, 348, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(BGPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(BGPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        pack();
    }


    protected abstract void GenerateQuestionsButtonActionPerformed(java.awt.event.ActionEvent evt) ;

    protected abstract void ImportButtonActionPerformed(java.awt.event.ActionEvent evt) ;

    protected abstract void BigUpdateButtonActionPerformed(java.awt.event.ActionEvent evt) ;

    protected abstract void SmallUpdateButtonActionPerformed(java.awt.event.ActionEvent evt) ;

    protected abstract void BackButtonActionPerformed(java.awt.event.ActionEvent evt) ;

    protected javax.swing.JPanel BGPanel;
    protected javax.swing.JButton BackButton;
    protected javax.swing.JButton BigUpdateButton;
    protected javax.swing.JLabel ButtonHeaderLabel;
    protected javax.swing.JButton CancelButton;
    protected javax.swing.JButton GenerateQuestionsButton;
    protected javax.swing.JButton ImportButton;
    protected javax.swing.JLayeredPane LayeredPane;
    protected javax.swing.JSeparator Separator;
    protected javax.swing.JButton SmallUpdateButton;
    protected javax.swing.JLabel SpinningDollarLabel;
    protected javax.swing.JLabel TopHeaderLabel;
    protected javax.swing.JLabel TopMessageLabel;
    protected javax.swing.JLabel TopMessageLabel1;
}
